<template>
	<view class="content">
		<view class="search">
			<image src="../../../static/shousuo.png"></image>
			<input type="text" placeholder="地方特产" />
		</view>
		<view class="small_log" >
			<view  class="log" :class="currentSwiperIndex===0 ? 'nav-actived':''" @tap="SwiperChange(0)">
					全部
			</view>
			<view class="log" :class="currentSwiperIndex===1 ? 'nav-actived':''" @tap="SwiperChange(1)">
					一方人
			</view>
			<view class="log" :class="currentSwiperIndex===2 ? 'nav-actived':''" @tap="SwiperChange(2)">
					农掌柜
			</view>
		</view>
			<swiper class="swiper-box" :style="'height:'+ swiperSliderHeight" :current="currentSwiperIndex" >
				<swiper-item class="swiper-item sns-now">	
					<view class="food_box">
						<view class="food_mouble" v-for="(item,i) in food ">
							<image class="food_pic" :src="$Config.HOST+'/public'+item.thump" mode=""></image>
							<text class="food_name">{{item.product_name}}</text>
							<text class="food_money">¥:{{item.price}}</text>
						</view>
						<view class="otherSpecialty">
						<view class="otherSpecialty_left">
							<text class="otherSpecialty_wz">其他产品</text>
							<image class="otherSpecialty_xl" src="../../../static/dfimages/xia.png" mode=""></image>
						</view>
							<image class="otherSpecialty_car" src="../../../static/dfimages/car.png" mode=""></image>
						</view>
					</view>
				</swiper-item>
				<swiper-item class="swiper-item sns-now">
					2222
				</swiper-item>
				<swiper-item class="swiper-item sns-now">
					333333
				</swiper-item>
			</swiper> 	
		
	</view>
</template>

<script>
	export default {
		data() {
			return {
				items:["全部","一方人","农掌柜"],
				count:0,
				currentSwiperIndex:0,
				swiperSliderHeight:'1000rpx',
				food:[]
			}
		},
		onLoad() {
			let that =this
			uni.request({
				url:'http://village.yqxbxb.com/api/villages/VillWithSpeacials?id=1',
				method:'GET',
				success(res) {
					// console.log(res);
					that.food = res.data.data
				}
			})
		},
		methods: {
			back() {
				uni.navigateBack({
					
				})
			},
			change(index){
				this.count=index;
			},
			//切换效果
			SwiperChange(index){
				this.currentSwiperIndex = index;
				}
		}
	}
</script>

<style>
	page {
	  background-color:#e1e4e1; 
	}
	.btna{
		display: flex;
		color: #1ADC1E; 
		background-color: #fff;
		border-bottom: 2px solid #1ADC1E;
		margin-bottom: 20rpx;
	}
.content {
		width: 100%;
		height: 100vh;
		padding-top: 50rpx;
		background-color: #e0e3e0;
	}
	.search {
		width: 620rpx;
		height: 65rpx;
		border-radius: 30rpx;
		background-color: #fff;
		margin: 0 auto;
		text-align: center;
		display: flex;
		justify-content: center;
		align-items: center;
	}
	.search image {
		width: 40rpx;
		height: 40rpx;
	}

	.search input {
		/* width: 100%; */

	}
	.local_center_wz{
		width: 90%;
		height: 50rpx;
		margin: 10rpx auto;
	}.local_center_title{
		margin-left: 50rpx;
		font-size: 32rpx;
	}
	.local_center_tecan{
		width: 90%;
		background-color: white;
		margin: auto;
	}
	.local_center_tecan_pic{
		width: 100%;
		height: 250rpx;
	}
	.local_center_tecan_title{
		width: 100%;
	}
	.small_log{
		width: 700rpx;
		height: 160rpx;
		margin: 20rpx auto;
		font-size: 40rpx;
		display: flex;
	}
	.log{
		display: flex;
		flex-direction: column;
		justify-content: center;
		align-items: center;
		margin: auto;		
		font-size: 35rpx;
		color:black;
		
	}
	.log:hover{
		  color: #1ADC1E;
		  text-decoration:underline;
	}
	.food_box{
		display: flex;	
		flex-wrap: wrap;
		width: 100%;
		padding-left:20rpx ;
	}
	.food_mouble{
		width: 220rpx;
		height: 380rpx;
		display: flex;
		margin:0 0 50rpx 10rpx ;
		flex-direction: column;
		background-color: white;
	}
	.food_pic{
		width: 220rpx;
		height: 250rpx;
		margin: auto;
	}
	.food_name{
		margin: 10rpx 40rpx;
		font-size: 30rpx;
	}
	.food_money{
		margin: 0 40rpx 20rpx;
		font-size: 38rpx;
		color: #FC0001;
	}
	.otherSpecialty{
		width: 100%;
		display: flex;
		justify-content: space-around;
		align-items: center;
	}
	.otherSpecialty_wz{
		font-size: 30rpx;
	}
	.otherSpecialty_left{
		display: flex;
	}
	.otherSpecialty_xl{
	 width: 50rpx;
	 height: 50rpx;
	}
	.otherSpecialty_car{
		width: 80rpx;
		height: 80rpx;
	}
</style>
